echo first 100 prime numbers php

41

echo first 100 prime numbers php -

<?php
for($i=1;$i<=100;$i++){
for($j = 1; $j<=$i; $j++){
 $temp = $i%$j;
 if($temp == 1){
 echo "is a prime number   ".$j."<br>";
 }
}
}
?>

Comments

Submit
0 Comments